package com.rsocket.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Controller;
import reactor.core.publisher.Mono;

/**
 * @author John Doe Tang
 * @date 2021年07月14日 10:24
 */
@Controller
@Slf4j
public class GreetingsController {

  @MessageMapping("request-response")
  Mono<String> reqResponse(@Payload String payload) {
    log.info("收到 RR 请求信息: {}", payload);
    return Mono.just("Hello, " + payload);
  }
}
